summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfc/nfc_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/nfc/nfc_interface.h')
-rw-r--r--src/core/hle/service/nfc/nfc_interface.h33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/core/hle/service/nfc/nfc_interface.h b/src/core/hle/service/nfc/nfc_interface.h
index 8c1bf5a59..08be174d8 100644
--- a/src/core/hle/service/nfc/nfc_interface.h
+++ b/src/core/hle/service/nfc/nfc_interface.h
@@ -3,20 +3,17 @@
#pragma once
-#include <array>
-#include <memory>
-#include <optional>
-
#include "core/hle/service/kernel_helpers.h"
+#include "core/hle/service/nfc/nfc_types.h"
#include "core/hle/service/service.h"
namespace Service::NFC {
-class NfcDevice;
+class DeviceManager;
-class Interface : public ServiceFramework<Interface> {
+class NfcInterface : public ServiceFramework<NfcInterface> {
public:
- explicit Interface(Core::System& system_, const char* name);
- ~Interface();
+ explicit NfcInterface(Core::System& system_, const char* name, BackendType service_backend);
+ ~NfcInterface();
void Initialize(HLERequestContext& ctx);
void Finalize(HLERequestContext& ctx);
@@ -31,22 +28,22 @@ public:
void GetTagInfo(HLERequestContext& ctx);
void AttachActivateEvent(HLERequestContext& ctx);
void AttachDeactivateEvent(HLERequestContext& ctx);
+ void ReadMifare(HLERequestContext& ctx);
+ void WriteMifare(HLERequestContext& ctx);
void SendCommandByPassThrough(HLERequestContext& ctx);
-private:
- enum class State : u32 {
- NonInitialized,
- Initialized,
- };
-
- std::optional<std::shared_ptr<NfcDevice>> GetNfcDevice(u64 handle);
+protected:
+ std::shared_ptr<DeviceManager> GetManager();
+ BackendType GetBackendType() const;
+ Result TranslateResultToServiceError(Result result) const;
+ Result TranslateResultToNfp(Result result) const;
+ Result TranslateResultToMifare(Result result) const;
KernelHelpers::ServiceContext service_context;
- std::array<std::shared_ptr<NfcDevice>, 10> devices{};
-
+ BackendType backend_type;
State state{State::NonInitialized};
- Kernel::KEvent* availability_change_event;
+ std::shared_ptr<DeviceManager> device_manager = nullptr;
};
} // namespace Service::NFC